using Unity.VisualScripting;
using GameFramework.Localization;

namespace LS.UGFUnits
{
    [UnitSurtitle("Network Property")]
    [UnitShortTitle("Get")]
    public sealed class GetNetworkProperty : NetworkUnit
    {
        [DoNotSerialize]
        public ValueOutput NetworkChannelCount { get; private set; }
        
        protected override void Definition()
        {
            base.Definition();
            NetworkChannelCount = ValueOutput<int>(nameof(NetworkChannelCount));
        }

        protected override ControlOutput In(Flow flow)
        {
            flow.SetValue(NetworkChannelCount, Target?.NetworkChannelCount ?? 0);
            return base.In(flow);
        }
    }
}